package cn.xxstudy.visitshop.ui.activity.main.fragment.interview.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import cn.xxstudy.visitshop.ui.activity.main.fragment.interview.model.InterviewData
import kotlinx.coroutines.launch

/**
 * @author ：DELL on 2021/3/26 .
 * @packages ：cn.xxstudy.visitshop.ui.activity.main.fragment.interview.viewmodel .
 * TODO:
 */
class InterviewViewModel : ViewModel() {
    val interviewLiveData = MutableLiveData<ArrayList<InterviewData>>()
    val failLiveData = MutableLiveData<String>()
    private val interviewRepository = InterviewRepository()

    fun interview(userId: String) {
        viewModelScope.launch {
            interviewRepository.interviewList(userId, interviewLiveData, failLiveData)
        }
    }
}